<template>
  <div>
    <h3>加法</h3>
    <div>{{num}}</div>
    <el-button type="primary" size="mini" @click="changeNum">改变</el-button>
  </div>
</template>

<script>
  export default {
    name: 'add',
    props: {
      num: {
        type: Number,
        default: 0
      },
    },
     methods: {
      changeNum() {
        let newNum = this.num + 1
        this.$emit('changes', newNum)
      }
    },
  }
</script>

<style lang="scss" scoped>

</style>